#define _CRT_SECURE_NO_WARNINGS 1
//判断一个二叉树是不是单值二叉树
bool isUnivalTree(struct TreeNode* root)
{
    if (root == NULL)
    {
        return true;
    }
    if (root->left != NULL && root->val != root->left->val)
    {
        return false;
    }
    else if (root->right != NULL && root->val != root->right->val)
    {
        return false;
    }
    return isUnivalTree(root->left) && isUnivalTree(root->right);
}

//二叉树最大深度
int maxDepth(struct TreeNode* root)
{
    if (root == NULL)
    {
        return 0;
    }

    return (int)fmax(maxDepth(root->left), maxDepth(root->right)) + 1;
}